package chpt03.shopping;


/**
 * 商品类：用来存放商品的信息(商品名称name、商品价格price)。
 * 该类有待完善。比如，未包含能唯一标识商品的商品编号属性。
 */
public class Commodity {
	private String name;
	private double price;
	
	public Commodity(String name) {
		this.name = name;
	}
	public Commodity(String name, double price) {
		this.name = name;
		this.price = price;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public double getPrice() {
		return price;
	}
	public void setPrice(double price) {
		this.price = price;
	}
	@Override
	public String toString() {
		return "Commodity [name=" + name + ", price=" + price + "]";
	}
}
